import 'osc_notice.dart';

class OscBlogCommentListEntity {
	List<OscBlogComment> commentList;
	int count;
	OscNotice notice;

	OscBlogCommentListEntity({this.commentList, this.count, this.notice});

	OscBlogCommentListEntity.fromJson(Map<String, dynamic> json) {
		if (json['commentlist'] != null) {
			commentList = new List<OscBlogComment>();(json['commentlist'] as List).forEach((v) { commentList.add(new OscBlogComment.fromJson(v)); });
		}
		count = json['count'];
		notice = json['notice'] != null ? new OscNotice.fromJson(json['notice']) : null;
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		if (this.commentList != null) {
      data['commentlist'] =  this.commentList.map((v) => v.toJson()).toList();
    }
		data['count'] = this.count;
		if (this.notice != null) {
      data['notice'] = this.notice.toJson();
    }
		return data;
	}
}

class OscBlogComment {
	List<OscCommentRefers> refers;//引用
	String author;
	int id;//评论ID
	int authorId;
	String portrait;//评论人头像
	String pubDate;
	String content;
	int appClient;//1-WEB、2-WAP、3-Android、4-IOS、5-WP

	OscBlogComment({this.refers, this.author, this.id, this.authorId, this.portrait, this.pubDate, this.content, this.appClient});

	OscBlogComment.fromJson(Map<String, dynamic> json) {
		if (json['refers'] != null) {
			refers = new List<OscCommentRefers>();(json['refers'] as List).forEach((v) { refers.add(new OscCommentRefers.fromJson(v)); });
		}
		author = json['author'];
		id = json['id'];
		authorId = json['authorid'];
		portrait = json['portrait'];
		pubDate = json['pubDate'];
		content = json['content'];
		appClient = json['appClient'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		if (this.refers != null) {
      data['refers'] =  this.refers.map((v) => v.toJson()).toList();
    }
		data['author'] = this.author;
		data['id'] = this.id;
		data['authorid'] = this.authorId;
		data['portrait'] = this.portrait;
		data['pubDate'] = this.pubDate;
		data['content'] = this.content;
		data['appClient'] = this.appClient;
		return data;
	}
}

class OscCommentRefers {
	String body;//评论中引用的内容
	String title;//评论中引用的标题

	OscCommentRefers({this.body, this.title});

	OscCommentRefers.fromJson(Map<String, dynamic> json) {
		body = json['body'];
		title = json['title'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['body'] = this.body;
		data['title'] = this.title;
		return data;
	}
}
